﻿<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <script id="allmobilize" charset="utf-8" src="style/js/allmobilize.min.js"></script>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="alternate" media="handheld"/>
    <!-- end 云适配 -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>
        [[${session.UserLookPosition.position.positionName}]]-[[${session.UserLookPosition.companyInfo.companyName}]]-伯乐网</title>
    <meta property="qc:admins" content="23635710066417756375"/>
    <meta name="baidu-site-verification" content="QIQ6KC1oZ6"/>

    <!-- <div class="web_root"  style="display:none">h</div> -->
    <script type="text/javascript">
        var ctx = "h";
        console.log(1);
    </script>
    <link rel="Shortcut Icon" href="h/images/favicon.ico">
    <link rel="stylesheet" type="text/css" href="style/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="style/css/external.min.css"/>
    <link rel="stylesheet" type="text/css" href="style/css/popup.css"/>
    <script src="style/js/jquery.1.10.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="style/js/jquery.lib.min.js"></script>
    <script src="style/js/ajaxfileupload.js" type="text/javascript"></script>
    <script src="style/js/jquery-hbzx.js" type="text/javascript"></script>
    <!--[if lte IE 8]>
    <script type="text/javascript" src="style/js/excanvas.js"></script>
    <![endif]-->
    <script type="text/javascript">
        var youdao_conv_id = 271546;
    </script>
    <script type="text/javascript" src="style/js/conv.js"></script>
    <!--layer.js-->
    <script type="text/javascript" src="style/js/layer/layer.js"></script>
</head>

<body>
<!--隐藏域 存放用户ID-->
<input type="hidden" id="userId" value="" th:if="${session.user==null || session.user.id==null}">
<input type="hidden" id="userId" th:value="${session.user.id}" th:if="${session.user!=null && session.user.id!=null}">
<!--隐藏域存放职位ID-->
<input type="hidden" id="positionId" th:value="${session.UserLookPosition.position.id}">

<div id="body">
    <!--引入顶部导航栏-->
    <div id="header" th:fragment="common_top_nav">
        <div class="wrapper">
            <a href="/index" class="logo">
                <img src="style/images/logo.png" width="229" height="43" alt="伯乐网-专注互联网招聘"/>
            </a>
            <ul class="reset" id="navheader">
                <li>
                    <a href="/index">首页</a>
                </li>
                <li>
                    <a href="companylist.html" style="margin-left: 50px">搜索公司</a>
                </li>
                <li th:if="${session.user != null}" class="jianli">
                    <a href="javascript:void(0)" rel="nofollow" style="margin-left: 50px">我的简历</a>
                </li>
            </ul>
            <!--未登陆显示登陆注册-->
            <ul class="loginTop" th:if="${session.user}==null">
                <li>
                    <a href="/loginPage" rel="nofollow">登录</a>
                </li>
                <li>|</li>
                <li>
                    <a href="/registerPage" rel="nofollow">注册</a>
                </li>
            </ul>
            <!--已经登陆显示下拉列表-->
            <dl class="collapsible_menu" th:if="${session.user}!=null">
                <dt>
                    <span th:text="${session.user.phone}">路人甲</span>
                    <span class="red dn" id="noticeDot-0"></span>
                    <i></i>
                </dt>
                <dd class="jianli">
                    <a rel="nofollow" href="javascript:void(0)">我的简历</a>
                </dd>
                <dd>
                    <a th:href="'/selectCollections?userId='+${session.user.id}">我收藏的职位</a>
                </dd>
                <dd>
                    <a th:href="'/myToudi?userId='+${session.user.id}">我投递的职位 <span id="noticeNo" class="red dn">(0)</span></a>
                </dd>
                <dd>
                    <a href="/setting">帐号设置</a>
                </dd>
                <dd class="logout">
                    <a rel="nofollow" href="/logout">退出</a>
                </dd>
            </dl>
            <script>
                //前往简历页面
                $(".jianli").click(function () {
                    //获取当前用户ID
                    var userId = $("#userId").val();
                    location.href = "/jianli?userId=" + userId;
                });
            </script>
        </div>
    </div>
    <!--顶部导航栏 end-->

    <div id="container">
        <div class="clearfix">
            <div class="content_l">
                <dl class="job_detail">
                    <dt>
                        <h1>
                            <em></em>
                            <div>[[${session.UserLookPosition.companyInfo.companyName}]]-[[${session.UserLookPosition.position.department}]]招聘</div>
							[[${session.UserLookPosition.position.positionName}]]
                        </h1>

                        <!--收藏按钮-->
                        <a class="jd_collection" id="collect" href="javascript:void(0)" title="收藏"></a>
                        <script>
                            //点击搜藏按钮触发的事件
                            $("#collect").click(function () {
                                //获取当前登陆人id
                                var userId=$("#userId").val().trim();
                                //获取职位ID
                                var positionId=$("#positionId").val().trim();

                                if(userId==null || userId==''){
                                    layer.alert("请先登陆！",{icon:2});
                                    return false;
                                }
                                //通过则发送请求，收藏该职位
                                $.ajax({
                                    type: "post",
                                    url: "/collectPosition/" + userId+"/"+positionId,
                                    success: function (result) {
                                        //成功的回调函数
                                        if (result.code == -1) {
                                            layer.alert("您已经收藏过该职位了",{icon:4});
                                            return false;
                                        }else if(result.code==0){
                                            layer.msg("职位收藏成功！");
                                            return false;
                                        }else if(result.code==1){
                                            layer.alert("职位太火爆，请稍后再试！",{icon:5});
                                            return false;
                                        } else {
                                            layer.alert("系统异常,请稍后再试！", {icon: 5});
                                        }
                                    }
                                });

                            });
                        </script>

                    </dt>
                    <dd class="job_request">
                        <span class="red">[[${session.UserLookPosition.position.leastSalary}]]K-[[${session.UserLookPosition.position.mostSalary}]]K</span>
                        <span th:text="${session.UserLookPosition.companyInfo.companyCity}" id="hidden_companyCity">公司所在城市</span>
                        <span th:text="${session.UserLookPosition.position.workSuffer}">工作经验</span>
                        <span th:text="${session.UserLookPosition.position.education}"> 学历要求</span>
                        <span th:text="${session.UserLookPosition.position.jobType}">工作性质</span><br/>
						职位诱惑 : [[${session.UserLookPosition.position.positionTempt}]]
                        <div>发布时间：[[${session.UserLookPosition.position.publishTime}]]</div>
                    </dd>
                    <dd class="job_bt">
                        <h3 class="description">职位描述</h3>
						[[${session.UserLookPosition.position.positionDescribe}]]
                    </dd>

                    <!--投递简历按钮-->
                    <dd>
                        <a onclick="toudi(this)" href="javascript:void(0);" class="btn fr btn_apply">投个简历</a>
                    </dd>
                    <script>
                        //点击投简历按钮触发事件
                        function toudi(t) {
                            //获取 职位id
                            var positionId = $("#positionId").val().trim();
                            //获取用户ID
                            var userId=$("#userId").val().trim();
                            if(userId==null || userId==''){
                                layer.alert("请先登陆！",{icon:2});
                                return false;
                            }
                            $.ajax({
                                type: "post",
                                url: "/toudi/" + userId+"/"+positionId,
                                success: function (result) {
                                    //成功的回调函数
                                    if(result.code==-2){
                                        //没有简历
                                        layer.alert("您无可用的简历，请先添加简历信息",{icon: 2});
                                        return false;
                                    }else if(result.code==-1){
                                        //重读投递
                                        layer.alert("该职位您已经投递过简历，请勿重复投递",{icon: 4});
                                        return false;
                                    } else if (result.code == 0) {
                                        //成功
                                        layer.alert("投递成功！请关注简历投递的最新动态",{icon: 1});
                                        return false;
                                    } else {
                                        layer.alert("系统异常,请稍后再试！", {icon: 5});
                                    }
                                }
                            });

                        }

                    </script>

                </dl>
                <div id="weibolist"></div>
            </div>
            <!--右边栏-->
            <div class="content_r">
                <dl class="job_company">
                    <dt>
                        <a th:href="'/company?companyId='+${session.UserLookPosition.companyInfo.id}" target="_blank">
                            <img class="b2" th:src="'companyLogo/'+${session.UserLookPosition.companyInfo.companyLogo}" width="80"
                                 height="80"/>
                            <div>
                                <h2 class="fl">
                                    [[${session.UserLookPosition.companyInfo.companyName}]]
                                    <img src="style/images/valid.png" width="15" height="19" alt="伯乐认证企业"/>
									<span class="dn">伯乐认证企业</span>
                                </h2>
                            </div>
                        </a>
                    </dt>
                    <dd>
                        <ul class="c_feature reset">
                            <li><span>领域</span>[[${session.UserLookPosition.companyInfo.companyField}]]</li>
                            <li><span>规模</span>[[${session.UserLookPosition.companyInfo.companyScale}]]</li>
                            <li>
                                <span>主页</span>
                                <a href="javascript:void(0)"rel="nofollow">[[${session.UserLookPosition.companyInfo.companyUrl}]]</a>
                            </li>
                        </ul>

                        <h4>发展阶段</h4>
                        <ul class="c_feature reset">
                            <li><span>目前阶段</span>[[${session.UserLookPosition.companyInfo.companyStage}]]</li>
                        </ul>

                        <h4>工作地址</h4>
                        <div id="hidden_workCity">[[${session.UserLookPosition.position.workCity}]]</div>
                        <div id="smallmap"></div>
                        <a href="javascript:;" id="mapPreview">查看完整地图</a>
                    </dd>
                </dl>
                <a href="javascript:void(0)" class="eventAd">
                    <img src="style/images/zhouyou.jpg" width="280" height="135"/>
                </a>
            </div>
        </div>


        <div id="tipOverlay"></div>
        <div style="display:none;">

            <!--地图弹窗-->
            <div id="baiduMap" class="popup">
                <div id="allmap"></div>
            </div>
            <!--/#baiduMap-->
        </div>
        <!------------------------------------- end ----------------------------------------->

        <script type="text/javascript" src="style/js/job_detail.js"></script>
        <script type="text/javascript" src="style/js/count.js"></script>
        <script>
            $(function () {
                $('#weibolist .cookietxte').text('推荐本职位给好友');
                $(document).bind('cbox_complete', function () {
                    hbzxJQ("#gaosutapt .pttui a").trigger("click");
                    hbzxJQ("#mepingpt .pttui a").trigger("click");
                });
                $('#cboxOverlay').bind('click', function () {
                    top.location.reload();
                });
                $('#colorbox').on('click', '#cboxClose', function () {
                    if ($(this).siblings('#cboxLoadedContent').children('div').attr('id') == 'deliverResumesSuccess' || $(this).siblings('#cboxLoadedContent').children('div').attr('id') == 'uploadFileSuccess') {
                        top.location.reload();
                    }
                });
            })
        </script>

        <script type="text/javascript"
                src="http://api.map.baidu.com/api?v=2.0&ak=3d6a9f4b807441569414b01eecc20959"></script>
        <script type="text/javascript">
            //百度地图API功能
            var sMap = new BMap.Map("smallmap");
            sMap.enableScrollWheelZoom(true);

            if ($('#positionLat').val() && $('#positionLng').val()) {
                var sPoint = new BMap.Point($('#positionLng').val(), $('#positionLat').val());
                sMap.centerAndZoom(sPoint, 12);
                sMap.addOverlay(new BMap.Marker(sPoint)); // 将标注添加到地图中

            } else {
                // 创建地址解析器实例
                var sMyGeo = new BMap.Geocoder();
                // 将地址解析结果显示在地图上,并调整地图视野
				var MyCity = $("#hidden_workCity").text().trim();
                sMyGeo.getPoint(MyCity, function (sPoint) {
                    if (sPoint) {
                        sMap.centerAndZoom(sPoint, 16);
                        sMap.addOverlay(new BMap.Marker(sPoint));
                    }
                }, "武汉");
            }

            /*弹窗大地图*/
            var map = new BMap.Map("allmap");
            map.addControl(new BMap.NavigationControl());
            map.addControl(new BMap.MapTypeControl());
            map.addControl(new BMap.OverviewMapControl());
            map.enableScrollWheelZoom(true);
            // 创建地址解析器实例
            var gc = new BMap.Geocoder();
            $(function () {
                $('#mapPreview').bind('click', function () {
                    $.colorbox({
                        inline: true,
                        href: "#baiduMap",
                        title: "公司地址"
                    });
                    var address = $("#hidden_workCity").text().trim();
                    var city = $("#hidden_companyCity").text().trim();
                    var lat = $('#positionLat').val();
                    var lng = $('#positionLng').val();
                    map.setCurrentCity(city);
                    map.setZoom(12);
                    if (lat && lng) {
                        var p = new BMap.Point(lng, lat);
                        var marker = new BMap.Marker(p); // 创建标注
                        map.addOverlay(marker); // 将标注添加到地图中
                        setTimeout(function () {
                            map.centerAndZoom(p, 15);
                        }, 1000);
                        map.setCenter(p);
                        map.setZoom(15);
                        var sContent =
                            "<h4 style='margin:0 0 5px 0;padding:0.2em 0'>" + city + "</h4>" +
                            "<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>" + address + "</p>" +
                            "</div>";
                        var infoWindow = new BMap.InfoWindow(sContent); // 创建信息窗口对象
                        //图片加载完毕重绘infowindow
                        marker.openInfoWindow(infoWindow);
                    } else {
                        gc.getPoint(address, function (point) {
                            if (point) {
                                var p = new BMap.Point(point.lng, point.lat);
                                var marker = new BMap.Marker(p); // 创建标注
                                map.addOverlay(marker); // 将标注添加到地图中
                                setTimeout(function () {
                                    map.centerAndZoom(p, 15);
                                }, 1000);
                                map.setZoom(14);
                                var sContent =
                                    "<h4 style='margin:0 0 5px 0;padding:0.2em 0'>" + city + "</h4>" +
                                    "<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>" + address + "</p>" +
                                    "</div>";
                                var infoWindow = new BMap.InfoWindow(sContent); // 创建信息窗口对象
                                //图片加载完毕重绘infowindow
                                marker.openInfoWindow(infoWindow);
                            }
                        }, city);
                    }

                });

            });
        </script>
        <div class="clear"></div>
        <input type="hidden" id="resubmitToken" value="6e1925fdbe7142468f154abd1d33f5a8"/>
        <a id="backtop" title="回到顶部" rel="nofollow"></a>
    </div>
    <!-- end #container -->
</div>
<!-- end #body -->
<!--引入页面底部备案号-->
<div th:replace="public/publicFragment::footer_nav"></div>

<script type="text/javascript" src="style/js/core.min.js"></script>
<script type="text/javascript" src="style/js/popup.min.js"></script>

<!--  -->

</body>

</html>